package com.share.dao.oa.org.impl;

import java.util.LinkedHashMap;
import java.util.List;

import org.springframework.stereotype.Component;

import com.share.bean.oa.org.Department;
import com.share.commons.base.dao.BaseDaoSupport;
import com.share.commons.base.query.PageModel;
import com.share.dao.oa.org.DepartmentDao;

@Component
public class DepartmentDaoImpl extends BaseDaoSupport<Department> implements DepartmentDao {

	@Override
	public void deleteDeptDao(Object[] dept) throws RuntimeException {
		this.deleteAllObject(Department.class, dept) ;
	}

	@Override
	public Department loadByIdDeptDao(String id) throws RuntimeException {
		
		return this.loadById(Department.class, id) ;
	}

	@Override
	public PageModel<Department> getScrollDeptDao(String hql,String whereHQL,List<Object> param, int firstResult,
			int maxResult, LinkedHashMap<String, String> orderby)
			throws RuntimeException {
		
		return this.getScrollData(hql, whereHQL, param, firstResult, maxResult, orderby) ;
	}

	@Override
	public void saveDeptDao(Department dept) throws RuntimeException {
		this.saveObject(dept) ;
	}

	@Override
	public void updateDeptDao(Department dept) throws RuntimeException {
		this.updateObject(dept) ;

	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Department> findDeptDao(String hql, String whereHQL,
			List<Object> param, LinkedHashMap<String, String> orderby)
			throws RuntimeException {
		return (List<Department>) this.find(hql, whereHQL, param, orderby) ;
	}

}
